

import java.rmi.Naming;
import java.rmi.RemoteException;
import java.net.MalformedURLException;

public class CalculPiServer {

	final static int N = 20;
	final static int n = 20*10000;
	public static void main(String[] args){
		try {
			for(int k = 0; k < N; k++){
				CalculPi obj = new CalculPi(k,N,n);
				Naming.rebind("rmi://localhost:1142/CalculPi" + k, obj);
			}
		}
		catch (RemoteException e){
			System.out.println("Remote problem while binding \"Hello\"-server.");	    
		} catch (MalformedURLException e){
			System.out.println("bad URL");
		}
		System.out.println("Servers for \"Calcul\" are up.");

		
	}
}
